Skip to content

Conversation

@Wodann
Copy link
Member

@Wodann Wodann commented Dec 30, 2025

This PR removes our custom EIP-3155 tracer and instead uses revm-inspector's DebugInspector. This brings us one step closer to unification of the tracing architecture, as we can use the same underlying inspector to generate our stack traces.

During testing, I discovered a bug in revm-inspectors. I was able to fix the bug and created a PR. After some back and forth, I'm waiting for the final approval. Until then, I decided to go ahead with a temporary dependency patch, using my fork of revm-inspectors. If desired, I can move the fork to the NomicFoundation organisation.

The hardhat-tests are using fixtures to validate that the generated output of debug_traceCall and debug_traceTransaction matches what Geth returns for specific requests. Unfortunately, the fixtures were old and no longer reflect the behaviour of the latest version of Geth. As such, I had to update the fixtures.

For future reference, I added instructions for how to generate new fixtures for future versions of Geth to each individual fixture. The instructions slightly differ per fixture as each fixture contains different JSON-RPC requests.

For fixtures that use "forking mode" I could not use Geth, since Geth does not support the concept of forking a blockchain. It can only fully sync to the live blockchain. To avoid a lot of time and storage to sync a node, I generated fixtures for "forking mode" by calling Alchemy. As Alchemy runs a mixture of clients (e.g. Erigon, Reth, and Geth), this does run a risk of hitting an Archive node that generates its JSON-RPC responses using Reth, which uses the same alloy dependency as us. I deemed this to be an acceptable trade-off to save a lot of time.

There is one outstanding issue. A previously disabled test can theoretically be re-enabled. However, I discovered a bug in REVM. I fixed the bug and created a PR. Once that's merged, I'll upgrade REVM and re-activate the test in a follow-up PR.

@Wodann Wodann self-assigned this Dec 30, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 30, 2025

🦋 Changeset detected

Latest commit: 7d64ffc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/edr Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Wodann Wodann force-pushed the feat/geth-debugger branch from 703348d to b1caf09 Compare December 31, 2025 07:01
@Wodann Wodann temporarily deployed to github-action-benchmark December 31, 2025 07:02 — with GitHub Actions Inactive
@socket-security
Copy link

socket-security bot commented Dec 31, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​hardhat@​2.28.094100929680

View full report

@Wodann Wodann temporarily deployed to github-action-benchmark December 31, 2025 07:06 — with GitHub Actions Inactive
@Wodann Wodann had a problem deploying to github-action-benchmark December 31, 2025 07:06 — with GitHub Actions Error
@Wodann Wodann requested a review from Copilot December 31, 2025 07:14
@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 69.66292% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.10%. Comparing base (abc925b) to head (7d64ffc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/edr_provider/src/debug_trace.rs 58.62% 21 Missing and 3 partials ⚠️
crates/edr_provider/src/data.rs 90.47% 0 Missing and 2 partials ⚠️
crates/edr_provider/src/error.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1251      +/-   ##
==========================================
- Coverage   74.13%   74.10%   -0.03%     
==========================================
  Files         437      437              
  Lines       74716    74598     -118     
  Branches    74716    74598     -118     
==========================================
- Hits        55389    55282     -107     
+ Misses      17302    17285      -17     
- Partials     2025     2031       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Wodann Wodann requested a review from a team December 31, 2025 07:14
@Wodann Wodann marked this pull request as ready for review December 31, 2025 07:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Geth built-in tracers by updating the Hardhat dependency from version 2.26.1 to 2.28.0 and implementing corresponding changes in the EDR codebase to handle debug tracing with Geth-compatible options.

Key Changes

  • Updates Hardhat to version 2.28.0 with patches to support Geth debug tracing
  • Replaces custom EIP-3155 tracer implementation with revm-inspectors DebugInspector
  • Updates test fixtures to match Geth 1.16.7 output format

Reviewed changes

Copilot reviewed 22 out of 28 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Updates Hardhat dependency from 2.26.1 to 2.28.0
pnpm-workspace.yaml Adds "hardhat" to immediate install exceptions
patches/[email protected] Adds patch file for Hardhat 2.28.0
patches/[email protected] Removes obsolete patch for Hardhat 2.26.1
crates/edr_provider/src/debug_trace.rs Replaces custom tracer with DebugInspector from revm-inspectors
crates/edr_provider/src/requests/debug.rs Updates debug trace methods to use GethDebugTracingOptions
crates/edr_provider/Cargo.toml Adds dependencies for alloy-rpc-types-trace and revm-inspectors
hardhat-tests/test/internal/hardhat-network/provider/utils/assertEqualTraces.ts Simplifies trace comparison logic
hardhat-tests/test/fixture-debug-traces/*.ts Updates test fixtures with Geth 1.16.7 traces
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Wodann Wodann temporarily deployed to github-action-benchmark December 31, 2025 07:22 — with GitHub Actions Inactive

Our API is now aligned with Geth's tracing capabilities.

BREAKING CHANGE: Memory capture used to be enabled by default on geth, but has since been flipped <https://github.com/ethereum/go-ethereum/pull/23558> and is now disabled by default. We have followed suit and disabled it by default as well. If you were relying on memory capture, you will need to explicitly enable it by setting the `enableMemory` option to `true` in your tracer configuration.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Wodann Wodann temporarily deployed to github-action-benchmark December 31, 2025 07:26 — with GitHub Actions Inactive
@Wodann Wodann had a problem deploying to github-action-benchmark December 31, 2025 07:26 — with GitHub Actions Failure
@Wodann
Copy link
Member Author

Wodann commented Jan 5, 2026

Lint error should be resolved by #1255

@Wodann Wodann requested a deployment to github-action-benchmark January 5, 2026 17:29 — with GitHub Actions In progress
@Wodann Wodann temporarily deployed to github-action-benchmark January 5, 2026 17:32 — with GitHub Actions Inactive
viaIR: true,
},
},
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Motivation: To ensure that the stack trace tests keep succeeding, we need to add new solc compiler descriptions up until the version of Solidity that EDR reports as supporting.

});

describe("Solidity support", function () {
it("check that the latest tested version is within the supported version range", async function () {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Motivation: When these tests lived in Hardhat, it made sense to ensure that there was a test to validate that the latest test version and the SUPPORTED_SOLIDITY_VERSION_RANGE matched.

Since these tests now live in EDR, there is no need to check that. We only need to ensure that we test all solc versions up until the one reported by EDR (latestSupportedSolidityVersion)

it("check that the latest tested version matches the one that EDR exports", async function () {
const latestSupportedVersion = getLatestTestedSolcVersion();
const edrLatestSupportedVersion = getLatestSupportedSolcVersion();
const edrLatestSupportedVersion = latestSupportedSolidityVersion();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Motivation: I replaced the previously hardcoded value from getLatestSupportedSolcVersion with the dynamic value in latestSupportedSolidityVersion that reports the latest supported Solidity version of Slang.

"ethers": "^6.1.0",
"fs-extra": "^7.0.1",
"hardhat": "2.26.1",
"hardhat": "2.28.0",
Copy link
Member Author

@Wodann Wodann Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The upgrade of Hardhat to 2.28.0 brought to light issues with the stack trace tests

@Wodann Wodann had a problem deploying to github-action-benchmark January 5, 2026 17:54 — with GitHub Actions Failure
@Wodann Wodann temporarily deployed to github-action-benchmark January 5, 2026 17:54 — with GitHub Actions Inactive
use std::{collections::HashMap, fmt::Debug};
use std::fmt::Debug;

use alloy_rpc_types_trace::geth::{GethDebugTracingOptions, GethTrace};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we re-export these types and rename them to DebugTracingOptions and Trace to avoid filling our code with references to geth?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to. I'm fine either way.

It signals that it matches the format defined by Geth, which we consciously follow. We can also rename it to something generic though. Would you like me to change it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whatever you feel best. It was just to bring it up in case you hadn't considered it

@Wodann Wodann temporarily deployed to github-action-benchmark January 8, 2026 15:28 — with GitHub Actions Inactive
@Wodann Wodann requested a review from anaPerezGhiglia January 8, 2026 15:31
@Wodann Wodann had a problem deploying to github-action-benchmark January 8, 2026 15:33 — with GitHub Actions Error
@Wodann Wodann had a problem deploying to github-action-benchmark January 8, 2026 15:33 — with GitHub Actions Error
@Wodann Wodann had a problem deploying to github-action-benchmark January 8, 2026 15:35 — with GitHub Actions Error
@Wodann Wodann temporarily deployed to github-action-benchmark January 8, 2026 15:37 — with GitHub Actions Inactive
@Wodann Wodann had a problem deploying to github-action-benchmark January 8, 2026 15:39 — with GitHub Actions Failure
@Wodann Wodann temporarily deployed to github-action-benchmark January 8, 2026 15:39 — with GitHub Actions Inactive
Copy link
Contributor

@anaPerezGhiglia anaPerezGhiglia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Wodann Wodann had a problem deploying to github-action-benchmark January 8, 2026 16:53 — with GitHub Actions Error
@Wodann Wodann temporarily deployed to github-action-benchmark January 8, 2026 16:54 — with GitHub Actions Inactive
@Wodann Wodann had a problem deploying to github-action-benchmark January 8, 2026 17:03 — with GitHub Actions Failure
@Wodann Wodann temporarily deployed to github-action-benchmark January 8, 2026 17:03 — with GitHub Actions Inactive
@Wodann Wodann temporarily deployed to github-action-benchmark January 30, 2026 21:24 — with GitHub Actions Inactive
@Wodann Wodann temporarily deployed to github-action-benchmark January 30, 2026 21:47 — with GitHub Actions Inactive
@Wodann Wodann had a problem deploying to github-action-benchmark January 30, 2026 21:47 — with GitHub Actions Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support standard prestateTracer supporting callTracer in debug_traceTransaction

3 participants